package com.movitech.mobile.cz.base.modules.config;

/**
 * 
 * 
 * @author Jack.Gong
 * @since 2018-03-29
 *
 */
public enum AttachmentSubTypeEnum {

	ATTACHMENTSUBTYPE_1("附件", 1),
	ATTACHMENTSUBTYPE_2("图片", 2),
	ATTACHMENTSUBTYPE_3("视频", 3),
	ATTACHMENTSUBTYPE_4("录音", 4);
	
	private String desc;
	private int code;

	private AttachmentSubTypeEnum(String desc, int code){
		this.desc = desc;
		this.code = code;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}
	public static String getNameByKey(int key){
		for(AttachmentSubTypeEnum i :AttachmentSubTypeEnum.values()){
			if(i.getCode()==key){
				return i.getDesc();
			}
		}
		return null;
	}
	
}
